﻿<!--  Copyright Microsoft Corporation -->
<!--  Author: Aravind Ramarathinam (aravr@microsoft.com) -->
 <UserControl x:Class="VmroleAuthor.Views.NetworkAdapterView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignWidth="900">
    <Grid VerticalAlignment="Top" ShowGridLines="False">
        <Grid.RowDefinitions>
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
            
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="6"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="6"/>
        </Grid.ColumnDefinitions>

        <!-- Name -->
        <Label Grid.Row="1" Grid.Column ="0" >Name</Label>
        <ContentControl Grid.Row="1" Grid.Column="2" Content="{Binding Path=Name}" />

        <!-- NetworkRef -->
        <Label Grid.Row="2" Grid.Column ="0" >NetworkRef</Label>
        <ContentControl Grid.Row="2" Grid.Column="2" Content="{Binding Path=NetworkRef}" />

        <!-- Ipv4AddressTypeEnabled -->
        <Label Grid.Row="3" Grid.Column ="0" >IPV4 Address Enabled?</Label>
        <CheckBox x:Name ="Ipv4AddressTypeEnabled" Grid.Row="3" Grid.Column="2" VerticalAlignment="Center"   Style="{StaticResource ResourceKey=CheckBoxStyle}" IsChecked="{Binding Ipv4AddressTypeEnabled, Mode=TwoWay, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}"/>
        <ContentPresenter Grid.Row="4" Grid.Column="2" Content="{Binding ElementName=Ipv4AddressTypeEnabled, Path=(Validation.Errors).CurrentItem}" />

        <!-- Ipv4AddressConfigurationName -->
        <Label Grid.Row="5" Grid.Column ="0" >IPV4 Address ConfigurationName</Label>
        <ContentControl Grid.Row="5" Grid.Column="2" Content="{Binding Path=Ipv4AddressConfigurationName}" IsEnabled="{Binding Path=Ipv4AddressTypeEnabled}">
            <ContentControl.Style>
                <Style TargetType="ContentControl">
                    <Style.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.4" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ContentControl.Style>
        </ContentControl>

        <!-- Ipv4AddressAllocationMethod -->
        <Label Grid.Row="6" Grid.Column ="0" >IPV4 Address AllocationMethod</Label>
        <ContentControl Grid.Row="6" Grid.Column="2" Content="{Binding Path=Ipv4AddressAllocationMethod}" IsEnabled="{Binding Path=Ipv4AddressTypeEnabled}">
            <ContentControl.Style>
                <Style TargetType="ContentControl">
                    <Style.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.4" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ContentControl.Style>
        </ContentControl>


        <!-- LoadBalancedBehindIPv4VIP -->
        <Label Grid.Row="7" Grid.Column ="0" >LoadBalanced Behind IPV4 VIP?</Label>
        <CheckBox x:Name ="LoadBalancedBehindIPv4VIP" Grid.Row="7" Grid.Column="2"  Style="{StaticResource ResourceKey=CheckBoxStyle}" IsChecked="{Binding LoadBalancedBehindIPv4VIP, Mode=TwoWay, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}"/>
        <ContentPresenter Grid.Row="8" Grid.Column="2" Content="{Binding ElementName=LoadBalancedBehindIPv4VIP, Path=(Validation.Errors).CurrentItem}" />

        <!-- IPv4LoadBalancerConfiguration -->        
        <Expander Grid.Row="9" Grid.Column="2" Header="IPV4 Load Balancer Config Details">
            <ContentControl Content="{Binding Path=IPv4LoadBalancerConfiguration}" IsEnabled="{Binding Path=LoadBalancedBehindIPv4VIP}">
                <ContentControl.Style>
                    <Style TargetType="ContentControl">
                        <Style.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Opacity" Value="0.4" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </ContentControl.Style>
            </ContentControl>
        </Expander>
        


        <!-- Ipv6AddressTypeEnabled -->
        <Label Grid.Row="11" Grid.Column ="0" >IPV6 Address Enabled?</Label>
        <CheckBox x:Name ="Ipv6AddressTypeEnabled" Grid.Row="11" Grid.Column="2" VerticalAlignment="Center"   Style="{StaticResource ResourceKey=CheckBoxStyle}" IsChecked="{Binding Ipv6AddressTypeEnabled, Mode=TwoWay, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}"/>
        <ContentPresenter Grid.Row="12" Grid.Column="2" Content="{Binding ElementName=Ipv6AddressTypeEnabled, Path=(Validation.Errors).CurrentItem}" />

        <!-- Ipv6AddressConfigurationName -->
        <Label Grid.Row="13" Grid.Column ="0" >IPV6 Address ConfigurationName</Label>
        <ContentControl Grid.Row="13" Grid.Column="2" Content="{Binding Path=Ipv6AddressConfigurationName}" IsEnabled="{Binding Path=Ipv6AddressTypeEnabled}">
            <ContentControl.Style>
                <Style TargetType="ContentControl">
                    <Style.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.4" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ContentControl.Style>
        </ContentControl>

        <!-- Ipv6AddressAllocationMethod -->
        <Label Grid.Row="14" Grid.Column ="0" >IPV6 Address AllocationMethod</Label>
        <ContentControl Grid.Row="14" Grid.Column="2" Content="{Binding Path=Ipv6AddressAllocationMethod}" IsEnabled="{Binding Path=Ipv6AddressTypeEnabled}">
            <ContentControl.Style>
                <Style TargetType="ContentControl">
                    <Style.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.4" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ContentControl.Style>
        </ContentControl>

        <!-- LoadBalancedBehindIPv6VIP -->
        <Label Grid.Row="16" Grid.Column ="0" >LoadBalanced Behind IPV6 VIP?</Label>
        <CheckBox x:Name ="LoadBalancedBehindIPv6VIP" Grid.Row="16" Grid.Column="2" VerticalAlignment="Center"  Style="{StaticResource ResourceKey=CheckBoxStyle}" IsChecked="{Binding LoadBalancedBehindIPv6VIP, Mode=TwoWay, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}"/>
        <ContentPresenter Grid.Row="17" Grid.Column="2" Content="{Binding ElementName=LoadBalancedBehindIPv6VIP, Path=(Validation.Errors).CurrentItem}" />

        <!-- IPv6LoadBalancerConfiguration -->      
        <Expander Grid.Row="18" Grid.Column="2" Header="IPV6 Load Balancer Config Details">
            <ContentControl Content="{Binding Path=IPv6LoadBalancerConfiguration}" IsEnabled="{Binding Path=LoadBalancedBehindIPv6VIP}">
                <ContentControl.Style>
                    <Style TargetType="ContentControl">
                        <Style.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Opacity" Value="0.4" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </ContentControl.Style>
            </ContentControl>
        </Expander>
            
    </Grid>  
</UserControl>
